package com.netty.admin.controller;

import cn.hutool.http.server.HttpServerRequest;
import com.netty.admin.service.UserService;
import com.netty.common.annotation.Log;
import com.netty.common.entity.result.Result;
import com.netty.common.enums.BusinessType;
import com.netty.common.enums.OperatorType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author LiuXiaoYu
 * @date 2022/2/7- 20:58
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getInfo")
    @Log(title = "获取当前登录的个人信息",businessType = BusinessType.GET,operatorType = OperatorType.USER)
    public Result<?> getUserInfo(HttpServletRequest request){
       return userService.getUserInfo(request);
    }
}
